package pkg

import (
	"github.com/gin-gonic/gin"
	"strconv"
)

func Pagination(c *gin.Context) (int, int, error)  {
	limit := c.DefaultQuery("pageSize", "10")
	pageNumber := c.DefaultQuery("pageNumber", "1")
	limitInt, err := strconv.Atoi(limit)
	pageNumberInt, err := strconv.Atoi(pageNumber)
	return (pageNumberInt - 1) * limitInt, limitInt, err
}